#!/usr/bin/env bash

VIM="/Applications/MacVim.app/Contents/MacOS/Vim -v"

# Set g:rooter_targets to ignore vim files so that loading the test scripts
# themselves doesn't trigger directory changes.
$VIM -u NONE -U NONE -N                \
  --cmd 'set rtp+=../'                 \
  --cmd 'let g:rooter_targets="*.txt"' \
  --cmd 'source ../plugin/rooter.vim'  \
  -S runner.vim                        \
  test_*.vim                           \
  $*

cat messages.log

grep -q "0 errors, 0 failures" messages.log
status=$?
rm messages.log
exit $status

